<template>
    <div>
      <van-address-edit
        :area-list="arealist"
        :address-info="addressInfo"
        show-postal
        show-delete
        show-set-default
        show-search-result
        @save="onSave"
        @delete="onDelete"
        @change-detail="onChangeDetail"
      />
    </div>
</template>

<script>
    export default {
        name: "addressEdit",
     /* props:['arealist'],*/
      data() {
        return {
          list:[
            { id: '1',
              name: '张三',
              tel: '13000000000',
              province:'江苏',
              city:'无锡',
              county:'崇安区',
              area_code:'120000',
              address: '浙江省杭州市西湖区文三路 138 号东方通信大厦 7 楼 501 室',
              postal_code:'123456',
            }
          ],
        }
      },

      methods: {

        onSave() {
          Toast('save');
        },
        onDelete(){
          Toast('delete');
        },
        onChangeDetail(val) {
          if (val) {
            this.searchResult = [{
              name: '黄龙万科中心',
              address: '杭州市西湖区'
            }];
          } else {
            this.searchResult = [];
          }
        }
      }
    }
</script>

<style scoped>
  .van-area .van-picker__frame {
    position: absolute !important;
  }
</style>
